package com.hits.zzbzstart.service;

import com.hits.zzbzstart.entity.TGzSx;
import com.hits.zzbzstart.entity.TGzSxCl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.BoundListOperations;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author wangshen
 * @ClassName 事项service
 * @Description TODO
 * @date 2020/12/22
 */
@Service
public class SxService {

    @Autowired
    private RedisTemplate redisTemplate;

    public List<TGzSx> sxList() {
        BoundListOperations sxList = this.redisTemplate.boundListOps("sxList");
        List<List<TGzSx>> list = sxList.range(0, sxList.size() - 1);
        return list.get(0);
    }

    public List<TGzSxCl> getSxclById(String sxid) {
        BoundListOperations sxList = this.redisTemplate.boundListOps(sxid);
        List<List<TGzSxCl>> list = sxList.range(0, sxList.size() - 1);
        return list.get(0);
    }
}
